/** 
* Copyright (C) 2012-2017 ZEEI Inc.All Rights Reserved.
* 项目名称：efs
* 文件名称：AlarmCodeController.java
* 包  名  称：com.zeei.efs.controller
* 文件描述：TODO 请修改文件描述
* 创建日期：2017年6月8日下午1:47:43
* 
* 修改历史
* 1.0 chenhuiqiong 2017年6月8日下午1:47:43 创建文件
*
*/


package com.zeei.app.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageInfo;
import com.zeei.app.service.AppVersionService;
import com.zeei.app.vo.AppVersionVO;
import com.zeei.common.annotation.SysLog;
import com.zeei.common.controller.BasicController;
import com.zeei.common.enums.LogType;
import com.zeei.common.vo.PageParamVO;
import com.zeei.common.vo.ResultBasicVO;
import com.zeei.common.vo.ResultRowsVO;


/**
 * 
* 类型名称：AppVersionController
* 类型描述：APP版本管理
* 功能描述：APP版本管理
* 创建作者：chenhuiqiong
*
 */
@Controller
@RequestMapping("/app/appVersion")
public class AppVersionController extends BasicController{
	@Autowired
	private AppVersionService appVersionService;
	
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	@ResponseBody
	@SysLog(text = "查询APP版本信息", type = LogType.View)
	public ResultRowsVO<AppVersionVO> queryAppVersion(AppVersionVO appVersionVO, PageParamVO pageParam){
		PageInfo<AppVersionVO> listData = appVersionService.queryAppVersion(appVersionVO, pageParam, true);
		List<AppVersionVO> appVersionList = listData.getList();
		return createResultRowsVO(appVersionList, true, "",(int)listData.getTotal());
	}
	
	@RequestMapping(value = "/add", method = RequestMethod.POST)
	@ResponseBody
	@SysLog(text = "新增APP版本信息", type = LogType.Add)
	public ResultBasicVO addAppVersion(AppVersionVO appVersionVO){
		boolean result = appVersionService.insertAppVersion(appVersionVO);
		return createResultBasicVO(result, "");
	}
	
	@RequestMapping(value = "/edit", method = RequestMethod.POST)
	@ResponseBody
	@SysLog(text = "修改APP版本信息", type = LogType.Edit)
	public ResultBasicVO editAlarmCode(AppVersionVO appVersionVO) {
		boolean result = appVersionService.updateAppVersion(appVersionVO);
		return this.createResultBasicVO(result, "");
	}
	
	@RequestMapping(value = "/drop", method = RequestMethod.POST)
	@ResponseBody
	@SysLog(text = "删除APP版本信息", type = LogType.Edit)
	public ResultBasicVO dropAlarmCode(AppVersionVO appVersionVO) {
		boolean result = appVersionService.deleteAppVersion(appVersionVO);
		return this.createResultBasicVO(result, "");
	}
}

